<?php

namespace Taxx\UserBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;

use Taxx\KernelBundle\Entity\User;
use Taxx\KernelBundle\Model\Utils\JsonTranslator;
use Taxx\KernelBundle\Model\Utils\PublicFileRegistry;
use Taxx\KernelBundle\Model\Utils\PasswordUtils;
use Symfony\Component\HttpFoundation\Session;
use Taxx\UserBundle\Forms\EditProfileForm;

class UserController extends Controller
{
    
    public function indexAction()
    {        
        
    }
    
    public function editProfileAction()
    {
        $session = $this->getRequest()->getSession();
        $language = $session->get('language');
        
        $em = $this->get('doctrine.orm.entity_manager');
        $translations = JsonTranslator::parseTranslationFile(PublicFileRegistry::getFilePath('user_translations'));
        
        $user = $em->getRepository('TaxxKernelBundle:User')->findOneBy(array("username" => $_POST['username']));
        
        $edit_profile_form = new EditProfileForm($em, $user, $language);
    }
    
}
